//
//  LEDownloadManager.h
//  WindRunner
//
//  Created by leeqb on 11/17/14.
//  Copyright (c) 2014 poweropt. All rights reserved.
//

@class LEDownloadManager;
@protocol DownloadManagerDelegate <NSObject>

@optional
- (void)downloadImage:(LEDownloadManager *)loadImage downloadFinished:(UIImage *)image;

@end

@interface LEDownloadManager : NSObject<NSURLConnectionDataDelegate>
{
    NSMutableData *_imageData;
    NSURLResponse *_response;
    
    NSMutableDictionary *_downloadQueue;
}

@property (nonatomic, copy)  NSString *filePath;
@property (nonatomic, assign) id <DownloadManagerDelegate> delegate;
@property (nonatomic, assign) NSInteger tag;
@property (nonatomic, retain) id target;

- (id)initWithTarget:(id)target;

- (void)downLoadImageWithURL:(NSString *)url imagetype:(NSString *)type; // 下载图片，缓存到本地，以url地址的md5串来命名

@end
